forum

home / developersection / forums / how can we reload store and refresh grid on button click in following code?

How can we reload store and refresh grid on button click in following code?

Simond Gear 1551 17-Feb-2017

How can we reload store and refresh grid on button click in following code?

updateClick:
function (field,
newValue, oldValue) {  //updateClick function call on update button click
        console.log(field);
        var me = this;
        var form = Ext.getCmp('userForm'); //get component of userForm and assign value into form variable
        var values = form.getValues(); //call getValue function by association of form variable and assign into values variable
        Ext.Ajax.request({     //send Ajax request to MVC controller request
            url: './User/Update',   //give path of method define in MVC controller
            method: 'POST',     //use POST method
            jsonData: values,   //send values in the form of jsonData
            success: function (response) {      //define success function
                var result = Ext.decode(response.responseText);
                if (result.success === true) {
                    Ext.Msg.show({
                        title: 'EMPLOYEE',
                        msg: result.message,
                        buttons: Ext.Msg.OK,
                        icon:Ext.MessageBox.INFORMATION
                    });
                }
                else {
                    Ext.Msg.show({
                        title: 'EMPLOYEE',
                        msg: result.message,
                        buttons: Ext.Msg.OK,
                        icon:Ext.MessageBox.ERROR
                    });
                }
            },
            failure: function () {  //define failure function on response of mvc controller
                Ext.Msg.show({
                    title: 'Record not Updated',
                    msg: result.message,
                    buttons: Ext.Msg.OK,
                    icon: Ext.MessageBox.ERROR
                });
            }
        });
    },

c# c# 
Updated on 17-Feb-2017
Simond Gear

Other


Message
Can you answer this question?

Answer

1 Answers

Liked By